/* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

compiler type api
API related to job compiler type

OpenAPI spec version: v1
Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/

#import <Foundation/Foundation.h>
#import <JDCloudOCSDKCompile/CompileApiModel.h>


@implementation CompileGetBuildStatusRequest
-(id) initWithRegion:(NSString *)regionId
jobid:(NSString*)jobid
idValue:(NSString*)idValue { 
    self.regionId = regionId;
    self.jobid = jobid;
    self.idValue = idValue;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
jobid:(NSString*)jobid
idValue:(NSString*)idValue { 
    self.regionId = regionId;
    self.version = version;
    self.jobid = jobid;
    self.idValue = idValue;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self jobid])
    {
        [result setValue:[self jobid] forKey:@"jobid"];
    }
    if([self idValue])
    {
        [result setValue:[self idValue] forKey:@"id"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.jobid = [dictionary objectForKey:@"jobid"];
    self.idValue = [dictionary objectForKey:@"id"];
    return self;
} 

@end
@implementation CompileStartJobRequest
-(id) initWithRegion:(NSString *)regionId
category:(NSString*)category
branch:(NSString*)branch
idValue:(NSString*)idValue { 
    self.regionId = regionId;
    self.category = category;
    self.branch = branch;
    self.idValue = idValue;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
category:(NSString*)category
branch:(NSString*)branch
idValue:(NSString*)idValue { 
    self.regionId = regionId;
    self.version = version;
    self.category = category;
    self.branch = branch;
    self.idValue = idValue;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self category])
    {
        [result setValue:[self category] forKey:@"category"];
    }
    if([self branch])
    {
        [result setValue:[self branch] forKey:@"branch"];
    }
    if([self idValue])
    {
        [result setValue:[self idValue] forKey:@"id"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.category = [dictionary objectForKey:@"category"];
    self.branch = [dictionary objectForKey:@"branch"];
    self.idValue = [dictionary objectForKey:@"id"];
    return self;
} 

@end
@implementation CompileDeleteJobRequest
-(id) initWithRegion:(NSString *)regionId
idValue:(NSString*)idValue { 
    self.regionId = regionId;
    self.idValue = idValue;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
idValue:(NSString*)idValue { 
    self.regionId = regionId;
    self.version = version;
    self.idValue = idValue;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self idValue])
    {
        [result setValue:[self idValue] forKey:@"id"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.idValue = [dictionary objectForKey:@"id"];
    return self;
} 

@end
@implementation CompileGetBuildLogRequest
-(id) initWithRegion:(NSString *)regionId
offsetNumber:(NSNumber*)offsetNumber
jobid:(NSString*)jobid
idValue:(NSString*)idValue { 
    self.regionId = regionId;
    self.offsetNumber = offsetNumber;
    self.jobid = jobid;
    self.idValue = idValue;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
offsetNumber:(NSNumber*)offsetNumber
jobid:(NSString*)jobid
idValue:(NSString*)idValue { 
    self.regionId = regionId;
    self.version = version;
    self.offsetNumber = offsetNumber;
    self.jobid = jobid;
    self.idValue = idValue;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self offsetNumber])
    {
        [result setValue:[self offsetNumber] forKey:@"offsetNumber"];
    }
    if([self jobid])
    {
        [result setValue:[self jobid] forKey:@"jobid"];
    }
    if([self idValue])
    {
        [result setValue:[self idValue] forKey:@"id"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.offsetNumber = [dictionary objectForKey:@"offsetNumber"];
    self.jobid = [dictionary objectForKey:@"jobid"];
    self.idValue = [dictionary objectForKey:@"id"];
    return self;
} 

@end
@implementation CompileGetBuildStatusResult
-(id) initWithName:(NSString*) name
        createdAt:(NSNumber*)createdAt
        status:(NSString*)status
        completionRate:(NSNumber*)completionRate { 
    self.name = name;               
    self.createdAt = createdAt;               
    self.status = status;               
    self.completionRate = completionRate;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self name])
    {
        [result setValue:[self name] forKey:@"name"];
    }
    if([self createdAt])
    {
        [result setValue:[self createdAt] forKey:@"createdAt"];
    }
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self completionRate])
    {
        [result setValue:[self completionRate] forKey:@"completionRate"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.name = [dictionary objectForKey:@"name"];
    self.createdAt = [dictionary objectForKey:@"createdAt"];
    self.status = [dictionary objectForKey:@"status"];
    self.completionRate = [dictionary objectForKey:@"completionRate"];
    return self;
} 

@end
@implementation CompileGetExternalLinkResult
-(id) initWithUrl:(NSString*) url
        token:(NSString*)token { 
    self.url = url;               
    self.token = token;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self url])
    {
        [result setValue:[self url] forKey:@"url"];
    }
    if([self token])
    {
        [result setValue:[self token] forKey:@"token"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.url = [dictionary objectForKey:@"url"];
    self.token = [dictionary objectForKey:@"token"];
    return self;
} 

@end
@implementation CompileCreateJobResult
-(id) initWithId:(NSString*) idValue
        codeRepoUrlLabel:(NSString*)codeRepoUrlLabel
        result:(NSNumber*)result { 
    self.idValue = idValue;               
    self.codeRepoUrlLabel = codeRepoUrlLabel;               
    self.result = result;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self idValue])
    {
        [result setValue:[self idValue] forKey:@"id"];
    }
    if([self codeRepoUrlLabel])
    {
        [result setValue:[self codeRepoUrlLabel] forKey:@"codeRepoUrlLabel"];
    }
    if([self result])
    {
        [result setValue:[self result] forKey:@"result"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.idValue = [dictionary objectForKey:@"id"];
    self.codeRepoUrlLabel = [dictionary objectForKey:@"codeRepoUrlLabel"];
    self.result = [dictionary objectForKey:@"result"];
    return self;
} 

@end
@implementation CompileDeleteJobsRequest
-(id) initWithRegion:(NSString *)regionId
jobIds:(NSArray<NSString*>*)jobIds { 
    self.regionId = regionId;
    self.jobIds = jobIds;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
jobIds:(NSArray<NSString*>*)jobIds { 
    self.regionId = regionId;
    self.version = version;
    self.jobIds = jobIds;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self jobIds])
    {
        [result setValue:[self jobIds] forKey:@"jobIds"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.jobIds = [dictionary objectForKey:@"jobIds"];
    return self;
} 

@end
@implementation CompileUpdateJobResult
-(id) initWithId:(NSString*) idValue
        codeRepoUrlLabel:(NSString*)codeRepoUrlLabel
        result:(NSNumber*)result { 
    self.idValue = idValue;               
    self.codeRepoUrlLabel = codeRepoUrlLabel;               
    self.result = result;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self idValue])
    {
        [result setValue:[self idValue] forKey:@"id"];
    }
    if([self codeRepoUrlLabel])
    {
        [result setValue:[self codeRepoUrlLabel] forKey:@"codeRepoUrlLabel"];
    }
    if([self result])
    {
        [result setValue:[self result] forKey:@"result"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.idValue = [dictionary objectForKey:@"id"];
    self.codeRepoUrlLabel = [dictionary objectForKey:@"codeRepoUrlLabel"];
    self.result = [dictionary objectForKey:@"result"];
    return self;
} 

@end
@implementation CompileStopBuildResult
-(id) initWithId:(NSString*) idValue
        result:(NSNumber*)result { 
    self.idValue = idValue;               
    self.result = result;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self idValue])
    {
        [result setValue:[self idValue] forKey:@"id"];
    }
    if([self result])
    {
        [result setValue:[self result] forKey:@"result"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.idValue = [dictionary objectForKey:@"id"];
    self.result = [dictionary objectForKey:@"result"];
    return self;
} 

@end
@implementation CompileGetExternalLinkRequest
-(id) initWithRegion:(NSString *)regionId
expires:(NSNumber*)expires
jobid:(NSString*)jobid
idValue:(NSString*)idValue { 
    self.regionId = regionId;
    self.expires = expires;
    self.jobid = jobid;
    self.idValue = idValue;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
expires:(NSNumber*)expires
jobid:(NSString*)jobid
idValue:(NSString*)idValue { 
    self.regionId = regionId;
    self.version = version;
    self.expires = expires;
    self.jobid = jobid;
    self.idValue = idValue;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self expires])
    {
        [result setValue:[self expires] forKey:@"expires"];
    }
    if([self jobid])
    {
        [result setValue:[self jobid] forKey:@"jobid"];
    }
    if([self idValue])
    {
        [result setValue:[self idValue] forKey:@"id"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.expires = [dictionary objectForKey:@"expires"];
    self.jobid = [dictionary objectForKey:@"jobid"];
    self.idValue = [dictionary objectForKey:@"id"];
    return self;
} 

@end
@implementation CompileGetJobRequest
-(id) initWithRegion:(NSString *)regionId
idValue:(NSString*)idValue { 
    self.regionId = regionId;
    self.idValue = idValue;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
idValue:(NSString*)idValue { 
    self.regionId = regionId;
    self.version = version;
    self.idValue = idValue;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self idValue])
    {
        [result setValue:[self idValue] forKey:@"id"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.idValue = [dictionary objectForKey:@"id"];
    return self;
} 

@end
@implementation CompileGetBuildLogResult
-(id) initWithLog:(NSString*) log
        offsetNumber:(NSNumber*)offsetNumber { 
    self.log = log;               
    self.offsetNumber = offsetNumber;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self log])
    {
        [result setValue:[self log] forKey:@"log"];
    }
    if([self offsetNumber])
    {
        [result setValue:[self offsetNumber] forKey:@"offsetNumber"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.log = [dictionary objectForKey:@"log"];
    self.offsetNumber = [dictionary objectForKey:@"offsetNumber"];
    return self;
} 

@end
@implementation CompileStopBuildRequest
-(id) initWithRegion:(NSString *)regionId
jobid:(NSString*)jobid
idValue:(NSString*)idValue { 
    self.regionId = regionId;
    self.jobid = jobid;
    self.idValue = idValue;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
jobid:(NSString*)jobid
idValue:(NSString*)idValue { 
    self.regionId = regionId;
    self.version = version;
    self.jobid = jobid;
    self.idValue = idValue;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self jobid])
    {
        [result setValue:[self jobid] forKey:@"jobid"];
    }
    if([self idValue])
    {
        [result setValue:[self idValue] forKey:@"id"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.jobid = [dictionary objectForKey:@"jobid"];
    self.idValue = [dictionary objectForKey:@"id"];
    return self;
} 

@end
@implementation CompileDeleteJobsResult
-(id) initWithResult:(NSNumber*) result
        ids:(NSArray<NSString*>*)ids { 
    self.result = result;               
    self.ids = ids;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self result])
    {
        [result setValue:[self result] forKey:@"result"];
    }
    if([self ids])
    {
        [result setValue:[self ids] forKey:@"ids"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.result = [dictionary objectForKey:@"result"];
    self.ids = [dictionary objectForKey:@"ids"];
    return self;
} 

@end
@implementation CompileStartJobResult
-(id) initWithCommitresult:(NSNumber*) commitresult
        buildUuid:(NSString*)buildUuid { 
    self.commitresult = commitresult;               
    self.buildUuid = buildUuid;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self commitresult])
    {
        [result setValue:[self commitresult] forKey:@"commitresult"];
    }
    if([self buildUuid])
    {
        [result setValue:[self buildUuid] forKey:@"buildUuid"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.commitresult = [dictionary objectForKey:@"commitresult"];
    self.buildUuid = [dictionary objectForKey:@"buildUuid"];
    return self;
} 

@end
@implementation CompileDeleteJobResult
-(id) initWithCommitresult:(NSNumber*) commitresult { 
    self.commitresult = commitresult;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self commitresult])
    {
        [result setValue:[self commitresult] forKey:@"commitresult"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.commitresult = [dictionary objectForKey:@"commitresult"];
    return self;
} 

@end
@implementation CompileCreateDemoResult
-(id) initWithJob:(Job*) job { 
    self.job = job;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self job])
    {
        [result setValue:[[self job] dictionary]forKey:@"job"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.job = [[Job alloc]initWithDic:[dictionary objectForKey:@"job"]];
    return self;
} 

@end
  
@implementation CompileCreateDemoResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
CompileCreateDemoResult* result = [[CompileCreateDemoResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(CompileCreateDemoResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation CompileCreateDemoRequest
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    return self;
} 

@end
  
@implementation CompileGetBuildStatusResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
CompileGetBuildStatusResult* result = [[CompileGetBuildStatusResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(CompileGetBuildStatusResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation CompileGetJobsRequest
-(id) initWithRegion:(NSString *)regionId
sorts:(NSArray<Sort*>*)sorts
pageNumber:(NSNumber*)pageNumber
pageSize:(NSNumber*)pageSize
filters:(NSArray<Filter*>*)filters { 
    self.regionId = regionId;
    self.sorts = sorts;
    self.pageNumber = pageNumber;
    self.pageSize = pageSize;
    self.filters = filters;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
sorts:(NSArray<Sort*>*)sorts
pageNumber:(NSNumber*)pageNumber
pageSize:(NSNumber*)pageSize
filters:(NSArray<Filter*>*)filters { 
    self.regionId = regionId;
    self.version = version;
    self.sorts = sorts;
    self.pageNumber = pageNumber;
    self.pageSize = pageSize;
    self.filters = filters;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self sorts])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self sorts] count]; i++) {
            Sort* item = [[self sorts] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"sorts"];
    }
    if([self pageNumber])
    {
        [result setValue:[self pageNumber] forKey:@"pageNumber"];
    }
    if([self pageSize])
    {
        [result setValue:[self pageSize] forKey:@"pageSize"];
    }
    if([self filters])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self filters] count]; i++) {
            Filter* item = [[self filters] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"filters"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* sortsArray = [dictionary objectForKey:@"sorts"];
    if(sortsArray&&![sortsArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [sortsArray count];i++)
        {
        Sort* item = [[Sort alloc]initWithDic:[sortsArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.sorts = propertyArray;
    }
    self.pageNumber = [dictionary objectForKey:@"pageNumber"];
    self.pageSize = [dictionary objectForKey:@"pageSize"];
    NSArray* filtersArray = [dictionary objectForKey:@"filters"];
    if(filtersArray&&![filtersArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [filtersArray count];i++)
        {
        Filter* item = [[Filter alloc]initWithDic:[filtersArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.filters = propertyArray;
    }
    return self;
} 

@end
@implementation CompileGetJobResult
-(id) initWithJob:(Job*) job { 
    self.job = job;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self job])
    {
        [result setValue:[[self job] dictionary]forKey:@"job"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.job = [[Job alloc]initWithDic:[dictionary objectForKey:@"job"]];
    return self;
} 

@end
@implementation CompileUpdateJobRequest
-(id) initWithRegion:(NSString *)regionId
data:(JobRequest*)data
idValue:(NSString*)idValue { 
    self.regionId = regionId;
    self.data = data;
    self.idValue = idValue;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
data:(JobRequest*)data
idValue:(NSString*)idValue { 
    self.regionId = regionId;
    self.version = version;
    self.data = data;
    self.idValue = idValue;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self data])
    {
        [result setValue:[[self data] dictionary]forKey:@"data"];
    }
    if([self idValue])
    {
        [result setValue:[self idValue] forKey:@"id"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.data = [[JobRequest alloc]initWithDic:[dictionary objectForKey:@"data"]];
    self.idValue = [dictionary objectForKey:@"id"];
    return self;
} 

@end
  
@implementation CompileGetExternalLinkResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
CompileGetExternalLinkResult* result = [[CompileGetExternalLinkResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(CompileGetExternalLinkResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
  
@implementation CompileUpdateJobResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
CompileUpdateJobResult* result = [[CompileUpdateJobResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(CompileUpdateJobResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
  
@implementation CompileGetJobResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
CompileGetJobResult* result = [[CompileGetJobResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(CompileGetJobResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
  
@implementation CompileCreateJobResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
CompileCreateJobResult* result = [[CompileCreateJobResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(CompileCreateJobResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation CompileGetJobsResult
-(id) initWithTotalCount:(NSNumber*) totalCount
        jobs:(NSArray<SimpleJob*>*)jobs
        requestId:(NSString*)requestId { 
    self.totalCount = totalCount;               
    self.jobs = jobs;               
    self.requestId = requestId;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self totalCount])
    {
        [result setValue:[self totalCount] forKey:@"totalCount"];
    }
    if([self jobs])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self jobs] count]; i++) {
            SimpleJob* item = [[self jobs] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"jobs"];
    }
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.totalCount = [dictionary objectForKey:@"totalCount"];
    NSArray* jobsArray = [dictionary objectForKey:@"jobs"];
    if(jobsArray&&![jobsArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [jobsArray count];i++)
        {
        SimpleJob* item = [[SimpleJob alloc]initWithDic:[jobsArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.jobs = propertyArray;
    }
    self.requestId = [dictionary objectForKey:@"requestId"];
    return self;
} 

@end
  
@implementation CompileGetJobsResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
CompileGetJobsResult* result = [[CompileGetJobsResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(CompileGetJobsResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation CompileCreateJobRequest
-(id) initWithRegion:(NSString *)regionId
data:(JobRequest*)data { 
    self.regionId = regionId;
    self.data = data;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
data:(JobRequest*)data { 
    self.regionId = regionId;
    self.version = version;
    self.data = data;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self data])
    {
        [result setValue:[[self data] dictionary]forKey:@"data"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.data = [[JobRequest alloc]initWithDic:[dictionary objectForKey:@"data"]];
    return self;
} 

@end
  
@implementation CompileGetBuildLogResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
CompileGetBuildLogResult* result = [[CompileGetBuildLogResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(CompileGetBuildLogResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
  
@implementation CompileDeleteJobResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
CompileDeleteJobResult* result = [[CompileDeleteJobResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(CompileDeleteJobResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
  
@implementation CompileStartJobResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
CompileStartJobResult* result = [[CompileStartJobResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(CompileStartJobResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
  
@implementation CompileDeleteJobsResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
CompileDeleteJobsResult* result = [[CompileDeleteJobsResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(CompileDeleteJobsResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
  
@implementation CompileStopBuildResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
CompileStopBuildResult* result = [[CompileStopBuildResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(CompileStopBuildResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
 
